#!/bin/bash

getopt -Qn 'Error' hm:p: "$@"
if [ $# -eq 0 ];
then echo usage: get_op_panel -m [\"managed system\"] -p [\"partition name\"]
exit 1
fi
if [ $1 = '-h' ];
then echo
echo usage get_op_panel -m [\"managed system\"] 
echo '     ' retrieves the LED panel value of a managed system
echo '   ' get_op_panel -m [\"managed system\"] -p [\"partition name\"]
echo '     ' retrieves the LED panel value for a logical partition on a managed system
echo
echo Options:
echo '   ' -m the name of the managed system enclosed in double quotes \" \"
echo '   ' -p the name of the logical partition enclosed in double quotes \" \"
echo '   ' -h brings up this help screen
echo
exit 0
fi

export CLASSPATH=/usr/websm/codebase/pluginjars/hmcdebug.jar:/opt/hsc:/usr/websm/codebase/pluginjars/sniacimom.jar:/usr/websm/codebase/pluginjars/xerces.jar:/usr/websm/codebase/pluginjars/sniacimom.jar:/usr/websm/codebase/pluginjars/HwmcaCommon.jar:/usr/websm/codebase/pluginjars/auifw.jar:$CLASSPATH
export PATH=/opt/IBMJava2-13/jre/bin:$PATH
if [ $# -eq 2 -a "$1" = '-m' ];
then java -Djavax.net.ssl.keyStore=/usr/websm/codebase/SM.pubkr -Djavax.net.ssl.keyStorePassword=defp -DcimomConfigFile=/opt/hsc/data/cimomcfg.properties com.ibm.hsc.common.util.GetOpPanel "\"$2\""
exit 0
fi

if [ '(' $# -eq 4 -a "$3" = '-p' ')' -a $1 = '-m' ];
then java -Djavax.net.ssl.keyStore=/usr/websm/codebase/SM.pubkr -Djavax.net.ssl.keyStorePassword=defp -DcimomConfigFile=/opt/hsc/data/cimomcfg.properties com.ibm.hsc.common.util.GetPartOpPanel "\"$2\"" "\"$4\""
exit 0
fi
echo Usage: get_op_panel -m [\"managed system\"] -p [\"partition name\"]
exit 1
